<template>

        <Dialog
                ref="err"
                dialogCls="mydlgg"
                headerCls="mydlgg-head"
                footerCls="mydlgg-foot"
                :dialogStyle="{ width: '600px' }"
                :modal="true"
                borderType="thin"
                :draggable="true"
        >
            <div slot="header">
                <span class="headerIcon newlyAdded"></span>
                <span class="titleStyle">{{ dialogTitle }}</span>
            </div>
            <div >
                <!-- 这个div必须保留 -->
<!--                <fieldset class="fieldsetStyle">-->
                    <!-- 表格容器   -->
                    <div style="height: 300px">
                        <bd-grid
                                style="width: 100%;height: 100%"
                                ref="grid"
                                :classId="classId"
                                :dataUrl="dataUrl"
                                :httpMethod="'httpMethod'"
                                :enableGridCheck="false"
                        ></bd-grid>
                    </div>
<!--                </fieldset>-->
            </div>
        </Dialog>

</template>

<script>
    import BdGrid from "../gridNoPage";

    export default {
        name: "errorDialog",
        components: {
            BdGrid,
        },
        props: {
            dataUrl: {
                type: String,
                default: 'api/sys/columns'
            },
            httpMethod: {
                type: String,
                default: 'GET'
            },
            classId: {
                type: Number,
                default: 78
            },
            dialogTitle: {
                type: String,
                default: '错误提示'
            }
        },
        data() {
            return {
                title: ''
            }
        },
        mounted() {
            this.$refs.err.close();
        },
        methods: {
            open(data) {
                this.$refs.err.open();
                this.$nextTick (()=>{
                    this.loadData(data);
                });
            },
            close() {
                this.$refs.err.close();
            },
            loadData(data) {
                this.$refs.grid.loadList(data);
            }
        }
    }
</script>

<style scoped>

</style>
